using System;
using System.Collections.Generic;
using System.Text;

namespace Developex.DatabaseWrapper.Fields
{
	/// <summary>
	/// 
	/// </summary>
	public class UpdatedByField_FK<T, FRow> : ForeignKeyField<T, FRow> where FRow : Row, new()
	{
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="name"></param>
		public UpdatedByField_FK(string name)
			: base(name)
		{
		}

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="name"></param>
		/// <param name="flags"></param>
		public UpdatedByField_FK(string name, FieldFlags flags)
			: base(name, flags)
		{
		}

		/// <summary>
		/// Set updated by user name
		/// </summary>
		/// <param name="conn"></param>
		/// <returns>true if changed</returns>
		public override bool SetUpdateAutoValue(Connection conn)
		{
			SetValue(conn.EventHandler.GetCurrentUser());
			return true;
		}
	}
}
